#ifndef _UTILS_COLOR_H_
# define _UTILS_COLOR_H_

# include "config.h"
# include <SDL/SDL.h>

NS_BEGIN(SDL)
	NS_BEGIN(UTILS)

	class Color
	{
	private:
		SDL_Color m_color;

	public:
		Color(Uint8 _r = 0, Uint8 _g = 0, Uint8 _b = 0);
		Color(SDL_Color const& _color);
		Color(Uint32 _color);
		Color(Color const& _color);
		~Color();

		Color& operator=(Color const& _color);
		bool operator==(Color const& _color) const;
		bool operator!=(Color const& _color) const;

		static void InitSDLColor(SDL_Color& _color, Uint8 _r, Uint8 _g, Uint8 _b);

		void ToSDLColor(SDL_Color& _color) const;
		Uint32 ToUint32() const;

		SDL_Color const& GetColor() const;
		void SetColor(SDL_Color const& _color);
		Uint8 GetR() const;
		void SetR(Uint8 _r);
		Uint8 GetG() const;
		void SetG(Uint8 _g);
		Uint8 GetB() const;
		void SetB(Uint8 _b);

	public:
		__declspec(property(get=GetColor, put=SetColor)) SDL_Color color;
		__declspec(property(get=GetR, put=SetR)) Uint8 r;
		__declspec(property(get=GetG, put=SetG)) Uint8 g;
		__declspec(property(get=GetB, put=SetB)) Uint8 b;
	};

	NS_END(UTILS)
NS_END(SDL)

#endif // _UTILS_COLOR_H_
